package com.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.SqlSession;
import com.dao.ArchiveDao;
import com.pojo.Archive;
import com.util.MySqlSessionFactory;

public class ArchiveService {
	SqlSession ss=MySqlSessionFactory.getSqlSession();
	ArchiveDao dao=ss.getMapper(ArchiveDao.class);
	public void addarchive(
			@Param("archive_id") String archive_id,
			@Param("identity") String identity,
			@Param("name") String name,
			@Param("gender") String gender,
			@Param("birthday") String birthday,
			@Param("date_retire1") String date_r1,
			@Param("date_retire2") String date_r2,
			@Param("sp") String sp,
			@Param("fc") String fc,
			@Param("title") String title,
			@Param("seniority") String seniority
			){
		ss.commit();
		dao.addarchive(archive_id, identity, name, gender, birthday, date_r1, date_r2, sp, fc, title, seniority);
	};
	public List<Archive> queryOne(@Param("archive_id") String archive_id){
		ss.commit();
		return dao.queryOne(archive_id);
	};
	public Archive One(String id){
		ss.commit();
		return dao.One(id);
	}	
	public Archive del(String id){
		ss.commit();
		return dao.del(id);
	}	
	public List<Archive> query(){
		ss.commit();
		return dao.query();
	}
	public Archive queryid(){
		ss.commit();
		return dao.queryid();
	}
}
